home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.plaf.basic;
-
- import com.sun.java.swing.JSplitPane;
- import com.sun.java.swing.border.Border;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Graphics;
- import java.awt.Insets;
- import java.awt.Rectangle;
- import java.io.Serializable;
-
- public class BasicSplitPaneUI$SplitBorder implements Border, Serializable {
- private Color highlightColor;
- private Color shadowColor;
-
- public BasicSplitPaneUI$SplitBorder(Color highlight, Color shadow) {
- this.highlightColor = highlight;
- this.shadowColor = shadow;
- }
-
- public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
- JSplitPane splitPane = (JSplitPane)c;
- Component child = splitPane.getLeftComponent();
- if (splitPane.getOrientation() == 1) {
- if (child != null) {
- Rectangle cBounds = child.getBounds();
- g.setColor(this.shadowColor);
- g.drawLine(0, 0, cBounds.width + 1, 0);
- g.drawLine(0, 1, 0, cBounds.height + 2);
- g.setColor(this.highlightColor);
- g.drawLine(1, cBounds.height + 1, cBounds.width + 2, cBounds.height + 1);
- g.drawLine(cBounds.width + 1, 1, cBounds.width + 1, cBounds.height + 2);
- }
-
- child = splitPane.getRightComponent();
- if (child != null) {
- Rectangle var14 = child.getBounds();
- int maxX = var14.x + var14.width;
- int maxY = var14.y + var14.height;
- g.setColor(this.shadowColor);
- g.drawLine(var14.x - 1, 0, maxX, 0);
- g.drawLine(var14.x - 1, maxY, var14.x, maxY);
- g.drawLine(var14.x - 1, 0, var14.x - 1, maxY);
- g.setColor(this.highlightColor);
- g.drawLine(var14.x, maxY, maxX, maxY);
- g.drawLine(maxX, 0, maxX, maxY + 1);
- }
- } else {
- if (child != null) {
- Rectangle var15 = child.getBounds();
- g.setColor(this.shadowColor);
- g.drawLine(0, 0, var15.width + 1, 0);
- g.drawLine(0, 1, 0, var15.height + 1);
- g.setColor(this.highlightColor);
- g.drawLine(1 + var15.width, 0, 1 + var15.width, var15.height + 1);
- g.drawLine(0, var15.height + 1, var15.width, var15.height + 1);
- }
-
- child = splitPane.getRightComponent();
- if (child != null) {
- Rectangle var16 = child.getBounds();
- int maxX = var16.x + var16.width;
- int maxY = var16.y + var16.height;
- g.setColor(this.shadowColor);
- g.drawLine(0, var16.y - 1, 0, maxY);
- g.drawLine(maxX, var16.y - 1, maxX, var16.y);
- g.drawLine(0, var16.y - 1, var16.width, var16.y - 1);
- g.setColor(this.highlightColor);
- g.drawLine(0, maxY, var16.width + 1, maxY);
- g.drawLine(maxX, var16.y, maxX, maxY);
- }
- }
-
- }
-
- public Insets getBorderInsets(Component c) {
- return new Insets(1, 1, 1, 1);
- }
-
- public boolean isBorderOpaque() {
- return true;
- }
- }
-